package com.example.demo2.service.impl;

import com.example.demo2.dao.TestMapper;
import com.example.demo2.service.ICheckService;
import com.example.demo2.service.ITestCase4SupportsService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import static com.example.demo2.utils.HttpUtils.check;

@Slf4j
@Service
public class TestCase4SupportsServiceImpl implements ITestCase4SupportsService {

    @Autowired
    private TestMapper testMapper;
    @Autowired
    private ICheckService checkService;

    @Transactional(propagation = Propagation.SUPPORTS)
    @Override
    public void withSupports() {
        testMapper.insert("case4.2");
        check();
    }
}
